Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lxl-web, supersearch): Narrow search query when editing parts (LWS-273) #1190

Merged
merged 12 commits into from
Dec 18, 2024

Conversation

johanbissemattsson
Copy link
Contributor

@johanbissemattsson johanbissemattsson commented Dec 12, 2024

Description

Tickets involved

LWS-273

Solves

Narrows search query when editing parts. This is done to get more relevant suggestions inside the SuperSearch component.

Summary of changes

  • Get editedRanges by parsing the syntax tree server-side
  • Add tests
  • Only do search request if trimmed value isn't empty
  • Capitalize BooleanOperator rule in grammar (needed to be able to identify the operators)
  • Narrow down search query when editing qualifier parts

@johanbissemattsson johanbissemattsson changed the title LWS-273: feat(lxl-web, supersearch): Calculate edited ranges of query using cursor position LWS-273: feat(lxl-web, supersearch): Calculate edited ranges of query using cursor Dec 12, 2024
@johanbissemattsson johanbissemattsson changed the title LWS-273: feat(lxl-web, supersearch): Calculate edited ranges of query using cursor feat(lxl-web, supersearch): Calculate edited ranges of query using cursor (LWS-273) Dec 12, 2024
@johanbissemattsson
Copy link
Contributor Author

johanbissemattsson commented Dec 12, 2024

I have done some changes in the grammar file so run npm run prepare in packages/codemirror-lang-lxlquery before running lxl-web (the same is probably needed for packages/supersearch).

@johanbissemattsson johanbissemattsson changed the title feat(lxl-web, supersearch): Calculate edited ranges of query using cursor (LWS-273) feat(lxl-web, supersearch): Narrow down search query when editing parts (LWS-273) Dec 13, 2024
@johanbissemattsson johanbissemattsson changed the title feat(lxl-web, supersearch): Narrow down search query when editing parts (LWS-273) feat(lxl-web, supersearch): Narrow search query when editing parts (LWS-273) Dec 13, 2024
This allows us to also add relevent extra entries (e.g. `min-reverseLinks.totalItems` when searching for qualifiers)
@johanbissemattsson johanbissemattsson force-pushed the feat/LWS-273-find-using-cursor branch from fe95677 to e4f524c Compare December 13, 2024 14:06
@@ -47,15 +47,15 @@ freetext {

CompareOperator { ">" | "<" | ">=" | "<=" }

booleanOperator { "AND" | "OR" | "NOT" }
BooleanOperator { "AND" | "OR" | "NOT" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exporting BooleanOperator (oddly enough) breaks the highlighting of BooleanQuerys as it is implemented now. But of course we should do it.

My suggestion is when this and #1186 is merged, we properly re-add (the option to) highlighting operators within a valid BooleanQuery.

This allows the labels in #1186 to work as inteded. We need to sync what the Libris XL API needs first before we do something more.
@johanbissemattsson
Copy link
Contributor Author

7058bc1 adds a last-minute change which prevents the _q search param to be modified. This is needed to not break the labeling functionality in #1186. A new param named _qualifier is instead introduced which contains the qualifier related query.

The next step forward is to discuss exactly how the request to the Libris XL API should look like and then adapt getEditedPartEntries in a later PR.

Copy link
Contributor

@jesperengstrom jesperengstrom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

@johanbissemattsson johanbissemattsson merged commit 3aef8ac into develop Dec 18, 2024
4 checks passed
@johanbissemattsson johanbissemattsson deleted the feat/LWS-273-find-using-cursor branch December 18, 2024 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants